package com.ddmmo.exhibition.common.exception;

import com.ddmmo.exhibition.common.enums.ResponseCodeEnum;
import lombok.Data;

@Data
public class EmergencyException extends RuntimeException{

    private Integer code;
    private String message;
    private Object data;

    public EmergencyException(String message){
        super(message);
        this.code = ResponseCodeEnum.ERROR.getCode();
        this.message = message;
    }

    public EmergencyException(Integer code, String message){
        super(message);
        this.code = code;
        this.message = message;
    }

    public EmergencyException(Integer code, String message, Object data) {
        super(message);
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public EmergencyException(ResponseCodeEnum responseCodeEnum){
        this(responseCodeEnum.getCode(), responseCodeEnum.getMessage());
    }

    public EmergencyException(ResponseCodeEnum responseCodeEnum, String message){
        this(responseCodeEnum.getCode(), message);
    }

}
